#include<stdio.h>
int main()
{
	int a,b,c,d,e,m;
	int counter=0;

	
	for(int k=10000; k<=99999; k++)
	{
		m=k;
		a=m/10000;
		m=m%10000;
		b=m/1000;
		m=m%1000;
		c=m/100;
		m=m%100;
		d=m/10;
		e=m%10;

		if(a==e && b==d)
		{
			printf("%d%d%d%d%d\n", a,b,c,d,e);
			
			counter++;
		}
	

	}

	printf("There are %d palindrome between 10000 and 1000000\n", counter);

	 return 0;
}

		
	